sgdk
vdp_tile.h
Go to the documentation of this file.
00001 
00013 #ifndef _VDP_TILE_H_
00014 #define _VDP_TILE_H_
00015 
00020 #define TILE_ATTR_PRIORITY_MASK     0x8000
00021 
00026 #define TILE_ATTR_PALETTE_MASK      0x6000
00027 
00032 #define TILE_ATTR_VFLIP_MASK        0x1000
00033 
00038 #define TILE_ATTR_HFLIP_MASK        0x0800
00039 
00044 #define TILE_ATTR_MASK              (TILE_ATTR_PRIORITY_MASK | TILE_ATTR_PALETTE_MASK | TILE_ATTR_VFLIP_MASK | TILE_ATTR_HFLIP_MASK)
00045 
00059 #define TILE_ATTR(pal, prio, flipV, flipH)               (((flipH) << 11) + ((flipV) << 12) + ((pal) << 13) + ((prio) << 15))
00060 
00075 #define TILE_ATTR_FULL(pal, prio, flipV, flipH, index)   (((flipH) << 11) + ((flipV) << 12) + ((pal) << 13) + ((prio) << 15) + (index))
00076 
00077 
00092 typedef struct
00093 {
00094     u16 compression;
00095     u16 numTile;
00096     u32 *tiles;
00097 } TileSet;
00098 
00116 typedef struct
00117 {
00118     u16 compression;
00119     u16 w;
00120     u16 h;
00121     u16 *tilemap;
00122 } Map;
00123 
00124 
00142 void VDP_loadTileData(const u32 *data, u16 index, u16 num, u8 use_dma);
00161 u16 VDP_loadTileSet(const TileSet *tileset, u16 index, u8 use_dma);
00179 void VDP_loadFontData(const u32 *font, u16 length, u8 use_dma);
00197 u16 VDP_loadFont(const TileSet *font, u8 use_dma);
00198 
00219 void VDP_loadBMPTileData(const u32 *data, u16 index, u16 w, u16 h, u16 bmp_w);
00244 void VDP_loadBMPTileDataEx(const u32 *data, u16 index, u16 x, u16 y, u16 w, u16 h, u16 bmp_w);
00245 
00261 void VDP_fillTileData(u8 value, u16 index, u16 num, u8 use_dma);
00262 
00277 void VDP_setTileMap(u16 plan, u16 tile, u16 ind);
00294 void VDP_setTileMapXY(u16 plan, u16 tile, u16 x, u16 y);
00299 void VDP_fillTileMapRectByIndex(u16 plan, u16 tile, u16 ind, u16 num);
00319 void VDP_fillTileMap(u16 plan, u16 tile, u16 ind, u16 num);
00345 void VDP_fillTileMapRect(u16 plan, u16 tile, u16 x, u16 y, u16 w, u16 h);
00350 void VDP_clearTileMapRectByIndex(u16 plan, u16 ind, u16 num, u8 use_dma);
00372 void VDP_clearTileMap(u16 plan, u16 ind, u16 num, u8 use_dma);
00393 void VDP_clearTileMapRect(u16 plan, u16 x, u16 y, u16 w, u16 h);
00398 void VDP_fillTileMapRectIncByIndex(u16 plan, u16 basetile, u16 ind, u16 num);
00424 void VDP_fillTileMapInc(u16 plan, u16 basetile, u16 ind, u16 num);
00455 void VDP_fillTileMapRectInc(u16 plan, u16 basetile, u16 x, u16 y, u16 w, u16 h);
00460 void VDP_setTileMapRectByIndex(u16 plan, const u16 *data, u16 ind, u16 num, u8 use_dma);
00487 void VDP_setTileMapData(u16 plan, const u16 *data, u16 ind, u16 num, u8 use_dma);
00513 void VDP_setTileMapDataRect(u16 plan, const u16 *data, u16 x, u16 y, u16 w, u16 h);
00518 void VDP_setTileMapRectExByIndex(u16 plan, const u16 *data, u16 baseindex, u16 baseflags, u16 ind, u16 num);
00542 void VDP_setTileMapDataEx(u16 plan, const u16 *data, u16 basetile, u16 ind, u16 num);
00547 void VDP_setTileMapRectEx(u16 plan, const u16 *data, u16 baseindex, u16 baseflags, u16 x, u16 y, u16 w, u16 h);
00577 void VDP_setTileMapDataRectEx(u16 plan, const u16 *data, u16 basetile, u16 x, u16 y, u16 w, u16 h, u16 wm);
00578 
00602 u16 VDP_setMap(u16 plan, const Map *map, u16 basetile, u16 x, u16 y);
00634 u16 VDP_setMapEx(u16 plan, const Map *map, u16 basetile, u16 x, u16 y, u16 xm, u16 ym, u16 wm, u16 hm);
00635 
00636 
00637 #endif // _VDP_TILE_H_
 All Classes Files Functions Variables Typedefs Enumerations Defines